//This is a cmocean colormap
//All credit to Kristen Thyng
//This colormap is under the MIT License
//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb

namespace ScottPlot.Colormaps;

public class Tarn : IColormap
{
    public string Name => "Tarn";
    readonly CustomPalette Colormap;
    public Color GetColor(double position) => Colormap.GetColor(position);

    public Tarn()
    {
        Color[] colors =
        [
            new( 23, 35, 14 ),
            new( 24, 37, 14 ),
            new( 25, 39, 14 ),
            new( 27, 41, 15 ),
            new( 28, 42, 15 ),
            new( 29, 44, 15 ),
            new( 31, 46, 16 ),
            new( 32, 48, 16 ),
            new( 33, 49, 16 ),
            new( 34, 51, 16 ),
            new( 35, 53, 16 ),
            new( 37, 55, 16 ),
            new( 38, 56, 16 ),
            new( 39, 58, 16 ),
            new( 40, 60, 16 ),
            new( 42, 61, 16 ),
            new( 43, 63, 15 ),
            new( 44, 65, 15 ),
            new( 46, 66, 15 ),
            new( 47, 68, 14 ),
            new( 48, 70, 14 ),
            new( 50, 71, 13 ),
            new( 52, 73, 12 ),
            new( 54, 74, 12 ),
            new( 57, 75, 12 ),
            new( 60, 77, 13 ),
            new( 63, 78, 14 ),
            new( 66, 79, 15 ),
            new( 68, 80, 16 ),
            new( 71, 81, 17 ),
            new( 74, 83, 18 ),
            new( 77, 84, 19 ),
            new( 79, 85, 20 ),
            new( 82, 86, 21 ),
            new( 85, 87, 22 ),
            new( 87, 88, 23 ),
            new( 90, 89, 24 ),
            new( 93, 91, 25 ),
            new( 96, 92, 26 ),
            new( 98, 93, 26 ),
            new( 101, 94, 27 ),
            new( 104, 95, 28 ),
            new( 107, 96, 29 ),
            new( 109, 97, 30 ),
            new( 112, 98, 31 ),
            new( 115, 99, 32 ),
            new( 118, 100, 33 ),
            new( 120, 102, 33 ),
            new( 123, 103, 34 ),
            new( 126, 104, 35 ),
            new( 129, 105, 36 ),
            new( 132, 106, 37 ),
            new( 134, 107, 38 ),
            new( 137, 108, 39 ),
            new( 140, 109, 39 ),
            new( 143, 110, 40 ),
            new( 146, 111, 41 ),
            new( 149, 112, 42 ),
            new( 152, 113, 43 ),
            new( 155, 114, 44 ),
            new( 158, 115, 45 ),
            new( 160, 116, 46 ),
            new( 163, 117, 47 ),
            new( 166, 118, 48 ),
            new( 169, 119, 49 ),
            new( 172, 120, 50 ),
            new( 175, 121, 51 ),
            new( 178, 122, 53 ),
            new( 181, 123, 54 ),
            new( 184, 124, 55 ),
            new( 187, 125, 57 ),
            new( 190, 126, 58 ),
            new( 193, 127, 60 ),
            new( 196, 128, 62 ),
            new( 198, 129, 65 ),
            new( 201, 130, 68 ),
            new( 203, 132, 72 ),
            new( 204, 134, 76 ),
            new( 205, 136, 79 ),
            new( 206, 138, 83 ),
            new( 207, 140, 87 ),
            new( 208, 143, 90 ),
            new( 209, 145, 93 ),
            new( 210, 147, 97 ),
            new( 210, 150, 100 ),
            new( 211, 152, 104 ),
            new( 212, 154, 107 ),
            new( 213, 156, 111 ),
            new( 214, 159, 114 ),
            new( 215, 161, 117 ),
            new( 216, 163, 121 ),
            new( 217, 166, 124 ),
            new( 218, 168, 128 ),
            new( 219, 170, 131 ),
            new( 219, 173, 135 ),
            new( 220, 175, 138 ),
            new( 221, 177, 142 ),
            new( 222, 179, 145 ),
            new( 223, 182, 149 ),
            new( 224, 184, 152 ),
            new( 225, 186, 156 ),
            new( 226, 189, 159 ),
            new( 227, 191, 163 ),
            new( 228, 193, 166 ),
            new( 229, 196, 170 ),
            new( 230, 198, 173 ),
            new( 231, 200, 177 ),
            new( 232, 203, 180 ),
            new( 233, 205, 184 ),
            new( 234, 208, 187 ),
            new( 235, 210, 191 ),
            new( 236, 212, 194 ),
            new( 237, 215, 198 ),
            new( 239, 217, 201 ),
            new( 240, 219, 205 ),
            new( 241, 222, 209 ),
            new( 242, 224, 212 ),
            new( 243, 227, 216 ),
            new( 244, 229, 219 ),
            new( 246, 232, 223 ),
            new( 247, 234, 226 ),
            new( 248, 236, 229 ),
            new( 249, 239, 233 ),
            new( 250, 241, 236 ),
            new( 251, 243, 239 ),
            new( 252, 245, 242 ),
            new( 252, 246, 244 ),
            new( 252, 247, 246 ),
            new( 252, 247, 246 ),
            new( 252, 247, 245 ),
            new( 251, 246, 243 ),
            new( 251, 245, 240 ),
            new( 249, 244, 237 ),
            new( 248, 242, 234 ),
            new( 246, 240, 231 ),
            new( 244, 238, 227 ),
            new( 242, 236, 224 ),
            new( 240, 234, 220 ),
            new( 239, 232, 216 ),
            new( 237, 230, 213 ),
            new( 235, 228, 209 ),
            new( 233, 226, 205 ),
            new( 231, 223, 202 ),
            new( 229, 221, 198 ),
            new( 227, 219, 194 ),
            new( 225, 217, 191 ),
            new( 223, 215, 187 ),
            new( 221, 214, 184 ),
            new( 218, 212, 180 ),
            new( 215, 210, 178 ),
            new( 212, 209, 175 ),
            new( 209, 207, 173 ),
            new( 206, 206, 171 ),
            new( 203, 204, 170 ),
            new( 199, 203, 168 ),
            new( 196, 201, 167 ),
            new( 193, 200, 166 ),
            new( 190, 198, 165 ),
            new( 186, 196, 164 ),
            new( 183, 195, 163 ),
            new( 180, 193, 162 ),
            new( 177, 192, 161 ),
            new( 174, 190, 160 ),
            new( 171, 189, 159 ),
            new( 168, 187, 158 ),
            new( 165, 185, 157 ),
            new( 162, 184, 156 ),
            new( 159, 182, 155 ),
            new( 156, 181, 154 ),
            new( 153, 179, 153 ),
            new( 151, 178, 152 ),
            new( 148, 176, 151 ),
            new( 145, 174, 150 ),
            new( 142, 173, 149 ),
            new( 139, 171, 148 ),
            new( 136, 170, 147 ),
            new( 133, 168, 146 ),
            new( 130, 167, 146 ),
            new( 127, 165, 145 ),
            new( 124, 164, 144 ),
            new( 121, 162, 143 ),
            new( 118, 161, 142 ),
            new( 115, 159, 141 ),
            new( 112, 158, 140 ),
            new( 109, 156, 139 ),
            new( 106, 155, 138 ),
            new( 103, 154, 137 ),
            new( 100, 152, 137 ),
            new( 97, 151, 136 ),
            new( 94, 149, 135 ),
            new( 90, 148, 134 ),
            new( 87, 146, 133 ),
            new( 84, 145, 133 ),
            new( 81, 143, 132 ),
            new( 78, 142, 131 ),
            new( 74, 140, 131 ),
            new( 71, 139, 130 ),
            new( 68, 137, 130 ),
            new( 65, 136, 129 ),
            new( 61, 134, 128 ),
            new( 58, 133, 128 ),
            new( 55, 131, 127 ),
            new( 52, 129, 127 ),
            new( 49, 128, 126 ),
            new( 46, 126, 126 ),
            new( 44, 124, 125 ),
            new( 42, 123, 125 ),
            new( 39, 121, 124 ),
            new( 37, 119, 124 ),
            new( 36, 117, 123 ),
            new( 34, 116, 122 ),
            new( 33, 114, 122 ),
            new( 32, 112, 121 ),
            new( 32, 110, 120 ),
            new( 31, 108, 119 ),
            new( 31, 106, 118 ),
            new( 30, 105, 118 ),
            new( 30, 103, 117 ),
            new( 29, 101, 116 ),
            new( 29, 99, 115 ),
            new( 28, 97, 114 ),
            new( 28, 95, 113 ),
            new( 27, 93, 112 ),
            new( 26, 92, 111 ),
            new( 26, 90, 111 ),
            new( 25, 88, 110 ),
            new( 24, 86, 109 ),
            new( 24, 84, 108 ),
            new( 23, 83, 107 ),
            new( 22, 81, 107 ),
            new( 21, 79, 106 ),
            new( 20, 77, 105 ),
            new( 19, 75, 104 ),
            new( 18, 73, 104 ),
            new( 17, 72, 103 ),
            new( 16, 70, 102 ),
            new( 16, 68, 101 ),
            new( 15, 66, 101 ),
            new( 14, 64, 100 ),
            new( 13, 62, 99 ),
            new( 12, 60, 99 ),
            new( 11, 59, 98 ),
            new( 10, 57, 98 ),
            new( 9, 55, 97 ),
            new( 9, 53, 96 ),
            new( 9, 51, 96 ),
            new( 9, 49, 95 ),
            new( 10, 47, 94 ),
            new( 11, 45, 93 ),
            new( 12, 42, 91 ),
            new( 13, 40, 89 ),
            new( 14, 38, 88 ),
            new( 14, 36, 86 ),
            new( 15, 34, 84 ),
            new( 15, 32, 82 ),
            new( 16, 30, 79 ),
        ];

        Colormap = new CustomPalette(colors);
    }
}

